<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>notifacation.coffee</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="stylesheet" href="../../../../../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../../../../../css/github.css" type="text/css" media="screen" />
<script src="../../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../../../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>

</head>

<body>
    <div class="banner">
        
        <h1>
            notifacation.coffee
        </h1>
        <ul class="files">
            
            <li>
                app/assets/javascripts/push_service/notifacation.coffee
                
            </li>
            <li>Last modified: 2017-01-27 16:48:14 +0800</li>
        </ul>
    </div>

    <div id="bodyContent">
        <div id="content">
  
    <div class="description">
      
<p>App.order = App.cable.subscriptions.create “OrderChannel”,</p>

<pre><code>received: (data) -&gt;
  $(&#39;div#js-display-order-notification&#39;).css(&#39;display&#39;, &#39;block&#39;)
  $(&#39;div#js-display-friend-notification&#39;).append(
    &quot;&lt;audio src=&#39;/add_friend_notice.mp3&#39; autoplay=&#39;&#39;&gt;&lt;/audio&gt;&quot;
  );
  count = 0
  message = () -&gt;
    count++
    if count%2==1
      document.title=&#39;【你有新的消息】&#39;
    else
      document.title=&#39;【　　　　　　】&#39;
  setInterval(message, 800)</code></pre>

<p>App.friend = App.cable.subscriptions.create “FriendChannel”,</p>

<pre><code>received: (data) -&gt;
  $(&#39;div#js-display-friend-notification&#39;).css(&#39;display&#39;, &#39;block&#39;)
  $(&#39;div#js-display-friend-notification&#39;).append(
    &quot;&lt;audio src=&#39;/add_friend_notice.mp3&#39; autoplay=&#39;&#39;&gt;&lt;/audio&gt;&quot;
  );</code></pre>

    </div>
  


  


  
  


  


  

  



  

    

    

    


    


    <!-- Methods -->
              </div>

    </div>
  </body>
</html>
